import * as types from '../mutation-type.js'

const user = {
  state: {
    userData: {}
  },
  mutations: {
    [types.SET_LIST] (state, data) {
      state[data.type] = data.list || []
    },
    [types.SET_DETAIL] (state, data) {
      state[data.type] = data.info
    },
    [types.SET_OBJ_ATTR] (state, data) {
      state[data.obj][data.attr] = data.data
    }
  }
}

export default user
